package fp.poczadly.client.event;

import com.google.gwt.event.shared.GwtEvent;

import fp.poczadly.shared.User;

public class ReceivePrivateMessageEvent extends GwtEvent<ReceivePrivateMessageEventHandler>{

	public static Type<ReceivePrivateMessageEventHandler> TYPE = new Type<ReceivePrivateMessageEventHandler>();
	
	private User fromUser;
	
	public ReceivePrivateMessageEvent( User fromUser ) {
		this.fromUser = fromUser;
	}
	
	@Override
	public Type<ReceivePrivateMessageEventHandler> getAssociatedType() {
		return TYPE;
	}

	@Override
	protected void dispatch( ReceivePrivateMessageEventHandler handler ) {
		handler.receivePrivateMessage( this );
	}

	public User getFromUser() {
		return fromUser;
	}
	
}
